package com.yl.auth.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yl.auth.model.entity.Weiji;
import com.yl.auth.model.entity.Wenyu;
import com.yl.auth.model.vo.WeijiVo;
import com.yl.auth.model.vo.WenyuVo;
import com.yl.auth.service.WeijiService;
import com.yl.auth.service.WenyuService;
import com.yl.common.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ln
 * @since 2023-06-19
 */
@Api(tags = "养老护理-老人文娱")
@RestController
@RequestMapping("/admin/wenyu")
public class WenyuController {
    @Resource
    private WenyuService wenyuService;

    @GetMapping ("/getwenyu/{page}/{limit}")
    @ApiOperation(value = "获取全部精神慰藉信息")
    public Result getwenyu(@PathVariable Integer page, @PathVariable Integer limit, @ApiParam("老人名称")String lrname, @ApiParam("上报时间")String sbtime){
        Page<WenyuVo> iPage = new Page<>(page,limit);
        Page<WenyuVo> pageVo = wenyuService.getwenyu(iPage, lrname, sbtime);
        return Result.ok(pageVo);
    }
    @GetMapping("/getwenyuById/{id}")
    @ApiOperation(value = "根据Id查询")
    public Result getwenyuById(@PathVariable @ApiParam("老人文娱id")Integer id){
        WenyuVo wenyuVo = wenyuService.getwenyuById(id);
        return Result.ok(wenyuVo);
    }
}

